package entitiesIds;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * UsertutorialId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class UsertutorialId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 5081340338110928679L;
	private Integer idUser;
	private Integer idTutorial;

	// Constructors

	/** default constructor */
	public UsertutorialId() {
	}

	/** full constructor */
	public UsertutorialId(Integer idUser, Integer idTutorial) {
		this.idUser = idUser;
		this.idTutorial = idTutorial;
	}

	// Property accessors

	@Column(name = "idUser", nullable = false)
	public Integer getIdUser() {
		return this.idUser;
	}

	public void setIdUser(Integer idUser) {
		this.idUser = idUser;
	}

	@Column(name = "idTutorial", nullable = false)
	public Integer getIdTutorial() {
		return this.idTutorial;
	}

	public void setIdTutorial(Integer idTutorial) {
		this.idTutorial = idTutorial;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UsertutorialId))
			return false;
		UsertutorialId castOther = (UsertutorialId) other;

		return ((this.getIdUser() == castOther.getIdUser()) || (this
				.getIdUser() != null && castOther.getIdUser() != null && this
				.getIdUser().equals(castOther.getIdUser())))
				&& ((this.getIdTutorial() == castOther.getIdTutorial()) || (this
						.getIdTutorial() != null
						&& castOther.getIdTutorial() != null && this
						.getIdTutorial().equals(castOther.getIdTutorial())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getIdUser() == null ? 0 : this.getIdUser().hashCode());
		result = 37
				* result
				+ (getIdTutorial() == null ? 0 : this.getIdTutorial()
						.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "UsertutorialId [idUser=" + idUser + ", idTutorial="
				+ idTutorial + "]";
	}
}